home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / !Interfaces / Universal Interfaces 2.0a1 / CIncludes / TranslationExtensions.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-17  |  3.9 KB  |  140 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        TranslationExtensions.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a1.  ETO #15, MPW prerelease.  Sunday, July 17, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __TRANSLATIONEXTENSIONS__
  18. #define __TRANSLATIONEXTENSIONS__
  19.  
  20.  
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24.  
  25. #if GENERATINGPOWERPC
  26. #pragma options align=mac68k
  27. #endif
  28.  
  29. #ifdef __CFM68K__
  30. #pragma lib_export on
  31. #endif
  32.  
  33. #define kSupportsFileTranslation 1
  34. #define kSupportsScrapTranslation 2
  35. #define kTranslatorCanGenerateFilename 4
  36. #ifndef REZ
  37.  
  38. #ifndef __MEMORY__
  39. #include <Memory.h>
  40. #endif
  41. /*    #include <Types.h>                                            */
  42. /*        #include <ConditionalMacros.h>                            */
  43. /*    #include <MixedMode.h>                                        */
  44.  
  45. #ifndef __FILES__
  46. #include <Files.h>
  47. #endif
  48. /*    #include <OSUtils.h>                                        */
  49.  
  50. #ifndef __QUICKDRAW__
  51. #include <Quickdraw.h>
  52. #endif
  53. /*    #include <QuickdrawText.h>                                    */
  54.  
  55. #ifndef __COMPONENTS__
  56. #include "Components.h"
  57. #endif
  58. typedef OSType FileType;
  59.  
  60. typedef ResType ScrapType;
  61.  
  62. typedef unsigned long TranslationAttributes;
  63.  
  64.  
  65. enum {
  66.     taDstDocNeedsResourceFork    = 1,
  67.     taDstIsAppTranslation        = 2
  68. };
  69.  
  70. struct FileTypeSpec {
  71.     FileType                        format;
  72.     long                            hint;
  73.     TranslationAttributes            flags;
  74.     OSType                            catInfoType;
  75.     OSType                            catInfoCreator;
  76. };
  77. typedef struct FileTypeSpec FileTypeSpec;
  78.  
  79. struct FileTranslationList {
  80.     unsigned long                    modDate;
  81.     unsigned long                    groupCount;
  82. };
  83. typedef struct FileTranslationList FileTranslationList;
  84.  
  85. typedef FileTranslationList *FileTranslationListPtr, **FileTranslationListHandle;
  86.  
  87. struct ScrapTypeSpec {
  88.     ScrapType                        format;
  89.     long                            hint;
  90. };
  91. typedef struct ScrapTypeSpec ScrapTypeSpec;
  92.  
  93. struct ScrapTranslationList {
  94.     unsigned long                    modDate;
  95.     unsigned long                    groupCount;
  96. };
  97. typedef struct ScrapTranslationList ScrapTranslationList;
  98.  
  99. typedef ScrapTranslationList *ScrapTranslationListPtr, **ScrapTranslationListHandle;
  100.  
  101. typedef long TranslationRefNum;
  102.  
  103. extern pascal OSErr SetTranslationAdvertisement(TranslationRefNum refNum, PicHandle advertisement)
  104.  TWOWORDINLINE(0x7002, 0xABFC);
  105. extern pascal OSErr UpdateTranslationProgress(TranslationRefNum refNum, short percentDone, Boolean *canceled)
  106.  TWOWORDINLINE(0x7001, 0xABFC);
  107.  
  108. enum {
  109.     kTranslateGetFileTranslationList = 0,
  110.     kTranslateIdentifyFile,
  111.     kTranslateTranslateFile,
  112.     kTranslateGetTranslatedFilename,
  113.     kTranslateGetScrapTranslationList = 10,
  114.     kTranslateIdentifyScrap,
  115.     kTranslateTranslateScrap
  116. };
  117.  
  118. typedef pascal ComponentResult (*DoGetFileTranslationListProcPtr)(ComponentInstance self, FileTranslationListHandle translationList);
  119. typedef pascal ComponentResult (*DoIdentifyFileProcPtr)(ComponentInstance self, const FSSpec *theDocument, FileType *docType);
  120. typedef pascal ComponentResult (*DoTranslateFileProcPtr)(ComponentInstance self, TranslationRefNum refNum, const FSSpec *sourceDocument, FileType srcType, long srcTypeHint, const FSSpec *dstDoc, FileType dstType, long dstTypeHint);
  121. typedef pascal ComponentResult (*DoGetTranslatedFilenameProcPtr)(ComponentInstance self, FileType dstType, long dstTypeHint, FSSpec *theDocument);
  122. typedef pascal ComponentResult (*DoGetScrapTranslationListProcPtr)(ComponentInstance self, ScrapTranslationListHandle list);
  123. typedef pascal ComponentResult (*DoIdentifyScrapProcPtr)(ComponentInstance self, const void *dataPtr, Size dataLength, ScrapType *dataFormat);
  124. typedef pascal ComponentResult (*DoTranslateScrapProcPtr)(ComponentInstance self, TranslationRefNum refNum, const void *srcDataPtr, Size srcDataLength, ScrapType srcType, long srcTypeHint, Handle dstData, ScrapType dstType, long dstTypeHint);
  125. #endif
  126.  
  127. #ifdef __CFM68K__
  128. #pragma lib_export off
  129. #endif
  130.  
  131. #if GENERATINGPOWERPC
  132. #pragma options align=reset
  133. #endif
  134.  
  135. #ifdef __cplusplus
  136. }
  137. #endif
  138.  
  139. #endif /* __TRANSLATIONEXTENSIONS__ */
  140.